package com.wandian.executor;

import java.util.HashMap;
import java.util.Map;
//import java.util.WeakHashMap;
import java.util.concurrent.TimeUnit;

import com.wandian.texas.BaseCommandObject;

/**
 * @author long
 * @Create 2012-10-11 下午2:11:02
 * @QQ 108232706
 * @version 1.0
 * @description TimerCommand
 */

public class TimerCommand extends BaseCommandObject {

	public Map<String, Object> params = new HashMap<String, Object>();
	public BaseCommandObject command;
	public void put(String key, Object value) {
		params.put(key, value);
	}

	public Object get(String key) {
		return params.get(key);
	}

	public void remove(String key) {
		params.remove(key);
	}

	@Override
	public void clear() {
		params.clear();
	}

	public TimerCommand() {
		super();
	}

	public TimerCommand(long delay) {
		super(delay);
	}

	public TimerCommand(String _name, short cmd, long delay) {
		this(_name, delay);
		this.setCmd(cmd);
	}

	public TimerCommand(String _name, short cmd, long delay, TimeUnit unit) {
		this(_name, delay, unit);
		this.setCmd(cmd);

	}

	public TimerCommand(String _name, long delay) {
		super(delay);
		this.name = _name;
	}

	public TimerCommand(String _name, long delay, TimeUnit _unit) {
		super(delay, _unit);
		this.name = _name;
	}

	public TimerCommand(String _name, short cmd, long delay, int _totalCount) {
		this(_name, delay, delay, _totalCount);
		this.setCmd(cmd);
	}

	public TimerCommand(String _name, long delay, int _totalCount) {
		this(_name, delay, delay, _totalCount);
	}

	public TimerCommand(long _initialDelay, long _period, int _totalCount) {
		super(_initialDelay, _period, _totalCount);
	}

	public TimerCommand(String _name, long _initialDelay, long _period, int _totalCount) {
		super(_name, _initialDelay, _period, _totalCount);
	}

	public TimerCommand(String _name, short cmd, long _initialDelay, long _period, int _totalCount, TimeUnit _unit) {
		super(_name, _initialDelay, _period, _totalCount, _unit);
		this.setCmd(cmd);
	}
	// public Runnable command;// 命令
	// public long runtime;//
	// public long delay;// 延时
	// public int totalCount;// 总共执行的次数，0的无限次，1只一次
	// public int currentCount;// 当前执行的次数
}
